nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]

for i in nums:
    print(i)

# 统计10以内的阶乘

i = 10
sum = 1

while i > 0:
    sum = sum * i
    i -= 1

print(sum)

print(range(10))

for i in range(10):
    print(i)

l = [1, 2, 3, 4, 5, 6]

# 将每个元素乘以2

l2 = []
for i in l:
    l2.append(i * 2)

print(l2)

# 列表推导式
l3 = [i * 2 for i in l]
print(l3)
print(l)

# enumerate  循环中获取元素的下标
for i, j in enumerate(l):
    print(i, j)
